import http from "@/utils/http";
// import axios from "axios";

export default {
  namespaced: true,

  state: {
    userList: [], // 正式用户数据
    accountRecordList: [], // 账变记录
    upDownList: [], //上下分记录
    ReceivablesList: [], //收款账户
    lotteryList: [] // 彩种记录
  },
  mutations: {
    SETUSERLIST(state, list) {
      state.userList = list;
    }
  },

  actions: {
    getUserList({ commit },{id,nickname,page}) {
      let token=sessionStorage.getItem('token')
      http
        .post(
          `/api/login/agent/get_wx?token=${token}&id=${id}&nickname=${nickname}&page=${page}`
        )
        .then(response => {
          let res = response.data.list;
          console.log(res,"response");
          commit("SETUSERLIST", res);
        });
    }
  }
};
